package com.happyfamily.springboot.crowdsourcingplatform.dao.weng;

import com.happyfamily.springboot.crowdsourcingplatform.model.BankAccount;
import com.happyfamily.springboot.crowdsourcingplatform.model.StationFlow;
import org.apache.ibatis.annotations.Delete;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Select;

import java.util.List;

@Mapper
public interface BackStationFlowDao
{
	@Select("select count(*) from station_flow")
	Long countAllStationFlow();

	@Select("select * from station_flow order by stime desc  limit #{startPosition},#{limit}")
	List<StationFlow> getAllStationFlowByPage(Integer startPosition, Integer limit);

	@Delete("delete from station_flow where sid = #{sid}")
	int deleteStationFlow(long sid);

	Long getFlowByFuzzy(String stype, String startTime, String endTime);

	List<StationFlow> getFlowByFuzzyPage(String stype, String startTime, String endTime, Integer startPosition, Integer limit);

	@Select("select count(*) from bank_account")
	Long getBankCount();

	@Select("select * from bank_account limit #{startPosition},#{limit}")
	List<BankAccount> getBankPage(Integer startPosition, Integer limit);
}
